<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.cyys.com/cyystaglib" prefix="cyys"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  	<meta charset="utf-8">
  	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  	<title>${SYSTEM_NAME}</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
</head>
<body >
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-header">登录日志</div>
		<div class="layui-card-body">
			<div class="layui-form layer-query" >
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">用户编号：</label>
						<div class="layui-input-inline">
							<input type="text" name="userId" placeholder="请输入用户编号"  id="userId" autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-inline">
						<label class="layui-form-label">日志类型：</label>
						<div class="layui-input-inline">
							<select name="desp" id="desp">
								<option value="">请选择日志类型</option>
								<option value="error">error</option>
								<option value="info">info</option>
							</select>
						</div>
					</div>

					<div class="layui-inline">
						<button class="layui-btn layui-btn-primary layui-border-blue" onclick="reload()">查询</button>
					</div>
				</div>
			</div>
			<hr class="layui-bg-green">
			<table class="layui-table" lay-filter="tableList" id="layerTable">
			</table>
		</div>
	</div>
</div>
	<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
	<script>
	//JavaScript代码区域
	var table;
	layui.use(['table'], function(){
	  table = layui.table;
	  table.render({ //其它参数在此省略
		  elem : '#layerTable',
		  even :"true",
		  limit: 20,
		  height: 'full-180',
		  limits: [10,20,30],
		  id: 'tableList',
		  url: getContextPath() + '/sys/log/list/logList',
		  where : { "type" : "1"},
		  page:true,
		  method: 'post', //如果无需自定义HTTP类型，可不加该参数
		  cols:  [[ //标题栏
			  {field:'userId', width:100,title:"用户编号"}
			 ,{field:'userRealName', width:100,title:"用户名称"}
			 ,{field:'module', width:120,title:"模块"}
			 ,{field:'method', title:"操作",width: 220}
			 ,{field:'requestUri', width:200,title:"响应地址"}
			 ,{field:'responseData', width:100,title:"响应时间"}
			 ,{field:'ip', width:120,title:"IP"}
			 ,{field:'data', minWidth:200,title:"执行时间"}
			 ,{field:'params', width:200,title:"参数"}
			 ,{field:'desp', width:80,title:"日志类型"}
			 ,{field:'exception', width:80,title:"异常"}
		   ]],
		  request: {
			  pageName: 'current', //页码的参数名称，默认：page
			  limitName: 'size' //每页数据量的参数名，默认：limit
		  } //如果无需自定义请求参数，可不加该参数
		});

	});

	function reload(){
		table.reload('tableList', {
		  where: {
			 "desp": $("#desp").val(),
			 "userId" : $("#userId").val()
		   }
		});
	}
	</script>
</body>
</html>